const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        brandName: 'chery',
        sourceCurrency: 1,
        targetCurrency: 1,
        rate: 1,
        beginDate: '2019-09-03T05:30:18.885Z',
        endDate: '2019-09-03T05:30:18.885Z',
        options: [
            'update'
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 40,
        }
    });
});
router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                brandId: '1',
                sourceCurrency: 1,
                targetCurrency: 1,
                rate: 1,
                beginDate: '2019-09-03T05:36:14.245Z',
                endDate: '2019-09-03T05:36:14.245Z',
                options: [
                    'update',
                ],
            }
        }
    );
});

router.post('/', (req, res) => {
    res.json({
        message: '新增成功'
    });
});

router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});

module.exports = router;
